package week15;

public class JieChengThread extends Thread{
    private int num;

    public JieChengThread() {
    }

    public JieChengThread(int num) {
        this.num = num;
    }

    @Override
    public void run() {
        int res=1;
        for (int i = 1; i <=num; i++) {
            res*=i;
        }
        System.out.println(num+"的阶乘为"+res);
    }
}
